package com.xbongbong.pro.dataset.enumus;

import lombok.Getter;

/**
 * @author gzt
 * @version 1.0
 * @Description -
 * @datetime - 2022/5/20-17:29
 * @since v1.0
 */
@Getter
public enum GroupTypeEnum {

        /**
         * 汇总类型
         */
        NONE(0, "none"),
        SUM(1, "sum"),
        AVERAGE(2, "average"),
        MAX(3, "max"),
        MIN(4, "min"),
        COUNT(5, "count"),
        COUNT_DISTINCT(6, "count_distict")
        ;

        private Integer type;

        private String memo;

    GroupTypeEnum(Integer type, String memo) {
            this.type = type;
            this.memo = memo;
        }

        public static GroupTypeEnum getGroupTypeEnum(String memo){
            for (GroupTypeEnum cache: values()){
                if(cache.getMemo().equals(memo)){
                    return cache;
                }
            }
            return null;
        }

    }